#include<iostream>

using std::endl;
using std::cout;

class Com
{
public:
    static Com* getinstance()
    {
        atexit(destory);
        _p=new Com();
        return _p;
    }
private:
    static void destory()
    {
        if(_p)
        {
            delete _p;
            _p=nullptr;
            
        }
    }
    ~Com()
    {
        cout<<"xigou"<<endl;
    }
    static Com* _p;
    int _x;
};
Com* Com::_p=nullptr;
int main(void)
{
    Com::getinstance();
}
